
import sys

class Solution:
    def __init__(self):
        pass

    def run(self,num):
        res = 0
        while num != 0 :
            tmp = num % 10
            if res <= -21474836 or res >= 21474836 :
                print(0)
                return 0
            res = res *10 + tmp
            num = num // 10

        print(res)
        return res

if __name__ == '__main__':
    s = Solution()
    # 2147483648
    # print(2**31)
    s.run(1474836)